<template lang="html">
  <div class="main-page" id="store-page">
    <!-- 标题 -->
    <!-- <van-nav-bar class="main-header" title="成为美家美货会员" :left-arrow="true" :fixed="true" :z-index="11" @click-left="onClickLeft"/> -->
    <nav-bar :title="'成为美家美货会员'"  @goBack="onClickLeft"/>

    <!-- 主体内容 -->
      <div class="main-content has-header-space">
        <UserPage page_type="join_vip" :invite_info="invite_info"></UserPage>
      </div>
  </div>
</template>

<script>
import UserPage from '@/components/merber/index/user_page.vue'
import NavBar from '@/components/global/nav-bar.vue'

export default {
  components: { UserPage, NavBar },
  data () {
    return {
      invite_info: {}
    }
  },
  created () {
    this.getVipInfo(this.$route.params.invite_code)
  },

  methods: {
    onClickLeft () {
      this.$router.go(-1)
    },
    switchTab (e) {
      this.active = e.target.dataset.i
    },
    getVipInfo (inviteId) {
      return new Promise((resolve, reject) => {
        this.$Axios({ url: 'verify_invite', params: { invite_id: inviteId }, method: 'get' }).then((resp) => { // 请求成功
          if (resp.return_code === '0000') {
            this.invite_info = resp.data
          }
          resolve(resp)
        }).catch((error) => { // 请求失败
          this.$_requestInterceptor('error', error)
          reject(error)
        })
      })
    }
  }
}
</script>
